package com.centaline.androidsalesblog.base;

import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;

import com.centaline.androidsalesblog.R;

import io.rong.imlib.model.Message;

/**
 * 右侧chat
 * Created by guilin on 16/3/16.
 */
public abstract class BaseRightChatVH extends BaseChatVH {

    public ProgressBar pb_sending;
    public ImageView img_warning;

    public BaseRightChatVH(View itemView) {
        super(itemView);
        pb_sending = (ProgressBar) itemView.findViewById(R.id.pb_sending);
        img_warning = (ImageView) itemView.findViewById(R.id.img_warning);
    }

    /**
     * 发送状态
     */
    public void sentStatus(Message.SentStatus sentStatus) {
        switch (sentStatus) {
            case SENDING:
                pb_sending.setVisibility(View.VISIBLE);
                img_warning.setVisibility(View.GONE);
                break;
            case FAILED:
                pb_sending.setVisibility(View.GONE);
                img_warning.setVisibility(View.VISIBLE);
                break;
            default:
                pb_sending.setVisibility(View.GONE);
                img_warning.setVisibility(View.GONE);
                break;
        }
    }

}
